<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<html>
<head>
<title>借款申请部门审批信息</title>
<%@include file="/common/ec.jsp"%>
<%@include file="/common/meta.jsp"%>
<style type="text/css">
.table {
	margin-top:1px;
	border-collapse: collapse;
	border-left-width: 0px;
	border-top-width: 0px;
}

.table tr th {
	line-height: 25px;
	background-color: #ECECEC;
	font-size: 14px;
}

.table tr td {
	line-height: 25px;
	padding: 2px;
	font-family: sans-serif;
}
</style>
</head>
<body>
<div class="x-panel">
  <div class="x-panel-header" style="border-bottom: 1px solid #A9BFD3;">&nbsp;借款申请审批</div>
    <table border="0" align="center">
    <tr>
	  <td align="right" valign="top" style="padding-right: 5px;">
		 <table width="400" class="table" border="1" bordercolor="#000" cellpadding="0" cellspacing="0">
			<tr> 
	           <th align="center" colspan="4">借款单</th>
	        </tr>	
			<tr>  
	           <td align="left" colspan="4">
	             &nbsp;&nbsp;借款部门：${model.flow.borrow.dept.name}
	             &nbsp;&nbsp;借款人：${model.flow.borrow.borrower.name}
	             &nbsp;&nbsp;借款时间： <s:date name="model.flow.borrow.createDate" format="yyyy-MM-dd HH:mm"/>
	           </td>
	        </tr>	
			<tr> 
	           <td align="right" width="80">借款单号：</td>
	           <td align="left" width="320" colspan="3">${model.flow.borrow.singleNo}</td>
	        </tr>         
			<tr> 
	           <td align="right">摘&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;要：</td>
	           <td align="left" colspan="3">${model.flow.borrow.title}</td>
	        </tr>        
			<tr> 
	           <td align="right">项目名称：</td>
	           <td align="left" colspan="3"> ${model.flow.borrow.project.name}</td>
	        </tr>
	        
			<tr> 
	           <td align="right" width="80">财务科目：</td>
	           <td align="left" width="170">${model.flow.borrow.item.name}</td>
			   <td align="right" width="50">金额：</td> 
			   <td width="100">${model.flow.borrow.amount}&yen;&nbsp;</td>
	        </tr>	
			<tr> 
				<td align="right">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</td>
				<td align="left" colspan="3">${model.flow.borrow.descn}</td>
			</tr>
		  </table>
		  <br>
		  <s:form id="saveAuditResult" method="post">
		    <s:hidden name="model.id" id="nodeId"/>
		    <s:hidden name="financeNodeType"/>
			<table class="table" width="400" border="1" bordercolor="#000" cellpadding="0" cellspacing="0">
			  <tr>
			    <th colspan="4">借款单审核</th>
			  </tr>	
			  <tr>
				<td align="right" width="80">&nbsp;&nbsp;&nbsp;审&nbsp;&nbsp;核&nbsp;&nbsp;人：</td>
				<td align="left" width="130">
				    <stc:username></stc:username>
				    <s:if test="model.dept != null">【${model.dept.name}】</s:if>
				</td>
				<td align="right" width="70">审批时间：</td>
				<td align="left" width="120">
				  <s:date name="model.audDate" format="yyyy-MM-dd HH:mm"/>
				</td>
			  </tr>	  
			  <tr>
			    <td align="right">是否通过：</td>
			    <td colspan="3">
			    	<s:radio list="statusMap" id="status" name="model.status" onchange="setStatusValue(this.value)"  cssStyle="border:0px;"/> 
		            <font color="red">*</font>
		        </td>
			  </tr>
			  <tr>
			    <td align="right">具体意见：</td>
				<td align="left" colspan="3">
				  <textarea rows="5" id="descn" name="model.descn" style="width:315px;height: 90px;"></textarea>
			    </td>
			  </tr>
			</table>
	      </s:form>
		  <table width="400">
		    <tr>
		      <td align="center" >
			    <input type="button" value="查看" class="button" onclick="viewBorrow('${model.flow.borrow.id}')"/>&nbsp;&nbsp;
                <input type="button" value="保存" class="button" onclick="return auditSave()"/>&nbsp;&nbsp;
				<input type="button" value="返回" class="button" onclick="javascript:history. back();" />
			  </td>
			</tr>
		 </table>				
	  </td>
	  
	  <td align="left" style="padding-left: 5px;">
		    <iframe name="iframe_selfBorrow" id="iframe_selfBorrow" width="440" height="220" src="${ctx}/borrow/selfIndex.do?borrowerId=${model.flow.borrow.borrower.id}" frameborder="0" scrolling="no"></iframe><br>
            <s:if test="model.dept != null && model.isFinance eq 0">
              <iframe name="iframe_deptBorrow" id="iframe_deptBorrow" width="440" height="220" src="${ctx}/borrow/deptIndex.do" frameborder="0" scrolling="no"></iframe><br>
            </s:if>
            <s:elseif test="model.dept == null && model.isFinance eq 0">
              <iframe name="iframe_projectBorrow" id="iframe_projectBorrow" width="440" height="220" src="${ctx}/borrow/projectIndex.do?projectId=${model.flow.borrow.project.id}" frameborder="0" scrolling="no"></iframe><br>
            </s:elseif>
            <s:elseif test="model.dept == null && model.isFinance eq 1">
             <iframe name="iframe_financeBorrow" id="iframe_financeBorrow" width="440" height="220" src="${ctx}/borrow/financeIndex.do" frameborder="0" scrolling="no"></iframe>
            </s:elseif>
	  </td>
   </tr>
</table>
</div>

<script type="text/javascript">
var statusVal = null;
function setStatusValue(aValue) {
	statusVal = aValue;
}	
function auditSave() {
	var frm = document.getElementById("saveAuditResult");
	if (statusVal == null || statusVal == "") {
		alert("请您选择审批是否通过！");
		return false;
	}
	if (confirm("您确认要审批此借款申请单吗？")){	
		frm.action = 'saveAuditNode.do';
		frm.submit();
	}else {
		return false;
	}
}	

function viewBorrow(borrowId) { 
	var url = '${ctx}/borrow/view.do?model.id=' + borrowId;
	var styles = "dialogWidth:780px; dialogHeight:465px; status:no; scroll:no; help:no";
	window.showModalDialog(url, null, styles);
}
</script>
</body>
</html>